<?php
/**
 * Created by PhpStorm.
 * User: kaycn
 * Date: 18-8-27
 * Time: 下午6:55
 */
namespace app\store\admin;

use app\admin\controller\Admin;

use app\common\builder\ZBuilder;

class Index extends Admin {

    public function index()
    {
        return ZBuilder::make('table')->fetch();
    }
    public  function add()
    {
        return ZBuilder::make('form')->setPageTitle('添加')->setPageTips('这是页面提示信息')
            ->addText('classid', '邮编')
            ->setUrl('http://localhost/gzhsvc/DolphinPHP/public/admin.php/store/index/sava')
            ->addFormItems([
                ['text', 'title', '标题'],
                ['textarea', 'summary', '摘要'],
                ['ueditor', 'content', '内容'],
                ['image', 'pic', '封面'],
                ['tags', 'tags', '标签'],
                ['file', 'files', '附件']
            ])
            ->fetch();
    }
    //保存数据
    public function sava(){
        file_put_contents("./txt.json",json_encode($_POST));
        $this->error('新增失败');
    }
}
